.TH std::extents,std::dextents 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::extents,std::dextents \- std::extents,std::dextents

.SH Synopsis
   Defined in header <mdspan>
   template< class IndexType, std::size_t... Extents > \fB(1)\fP (since C++23)
   class extents;
   template< class IndexType, std::size_t Rank >       \fB(2)\fP (since C++23)
   using dextents = /* see below */

   1) Represents a multidimensional index space of rank equal to sizeof...(Extents).
   2) A convenient alias template for an all-dynamic extents. Let d denote
   std::dynamic_extent, each specialization of it dextents<IndexType, Rank> is
   equivalent to extents<IndexType /*, d, d, ..., d*/> (i.e. d is repeated a total of
   Rank times).

   Each specialization of extents models regular and is TriviallyCopyable.

.SH Template parameters

   IndexType - the type of each non-dynamic Extents. Shall be a signed or unsigned
               integer type. Otherwise, the program is ill-formed
               represents extent (size of an integer interval) for each rank index.
               Each element of it is either equal to std::dynamic_extent (in this case,
   Extents   - it represents a dynamic extent and the extent size will be determined
               dynamically), or is representable as a value of type IndexType (then it
               represents a static extent and the extent size is just the value of it),
               or else the program is ill-formed
   Rank      - denotes the rank of an all-dynamic extents

.SH Member types

   Member type Definition
   index_type  IndexType
   size_type   std::make_unsigned_t<index_type>
   rank_type   std::size_t

.SH Member objects

   Member name               Definition
                             An array of type std::array<index_type, rank_dynamic()>,
   dynamic-extents (private) which stores the size of each dynamic extents.
                             (exposition-only member object*)

.SH Member functions

   constructor         constructs an extents
                       \fI(public member function)\fP
.SH Observers
   rank                returns the static rank of an extents
   \fB[static]\fP            \fI(public static member function)\fP
   rank_dynamic        returns the dynamic rank of an extents
   \fB[static]\fP            \fI(public static member function)\fP
   static_extent       returns static extent size of an extents at a certain rank index
   \fB[static]\fP            \fI(public static member function)\fP
                       returns dynamic extent size of an extents at a certain rank
   extent              index
                       \fI(public member function)\fP
         Helpers
   fwd-prod-of-extents returns the product of extent size in range [0, i)
                       (exposition-only member function*)
   rev-prod-of-extents returns the product of extents size in range [i + 1, rank())
                       (exposition-only member function*)
   index-cast          casts the input into an integer type
                       (exposition-only member function*)
   dynamic-index       returns the number of dynamic extents below a certain rank index
   (private)           (exposition-only member function*)
   dynamic-index-inv   returns the number r such that in range [0, r + 1) there is
   (private)           exactly i + 1 dynamic extents for a certain argument i
                       (exposition-only member function*)

.SH Non-member functions

   operator== compare underlying extents in each dimension of two extents
   (C++23)    \fI(function)\fP

   Deduction guides(C++23)

.SH Example

    This section is incomplete
    Reason: no example

.SH See also

   rank    obtains the number of dimensions of an array type
   \fI(C++11)\fP \fI(class template)\fP
   extent  obtains the size of an array type along a specified dimension
   \fI(C++11)\fP \fI(class template)\fP

.SH Category:
     * Todo no example
